package com.linewell.commom.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.linewell.system.model.SysCustomer;
import com.linewell.system.model.SysUsers;

/**
 * 客户回馈表
 * */
@Entity
@Table(name = "FEED_BACK")
@DynamicInsert(true)
@DynamicUpdate(true)
public class FeedBack  implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 4747865855609736829L;
	private Integer id;
	private SysCustomer sysCustomer;
	private String phone;//联系方式
	private String content;//内容
	private Date createTime;
	private SysUsers sysUsers;
	private String returContent;//回复内容
	private Date updateTime;//回复时间
	private Byte status;//9正常 1禁用
	
	@Id
	@Column(name = "ID", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO) // 自增长
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@ManyToOne(targetEntity = SysCustomer.class)
	@JoinColumn(name = "CUST_ID")  //非主键关联
	public SysCustomer getSysCustomer() {
		return sysCustomer;
	}
	public void setSysCustomer(SysCustomer sysCustomer) {
		this.sysCustomer = sysCustomer;
	}
	
	
	@Column(name = "PHONE", nullable = false)
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	
	@Column(name = "CONTENT", nullable = false ,length = 200)
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	@Column(name = "CRIBE_TIME",columnDefinition = "timestamp not null default CURRENT_TIMESTAMP")
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@ManyToOne(targetEntity = SysUsers.class)
	@JoinColumn(name = "USER_ID")
	public SysUsers getSysUsers() {
		return sysUsers;
	}
	public void setSysUsers(SysUsers sysUsers) {
		this.sysUsers = sysUsers;
	}
	
	
	//@NotEmpty(message="请输入回复内容！")
	@Column(name = "RETURN_CONTENT",length = 200)
	public String getReturContent() {
		return returContent;
	}
	public void setReturContent(String returContent) {
		this.returContent = returContent;
	}
	
	@Column(name = "STATUS", columnDefinition = "tinyint default 9")
	public Byte getStatus() {
		return status;
	}
	public void setStatus(Byte status) {
		this.status = status;
	}
	@Column(name = "UPDATE_TIME")
	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	@Override
	public String toString() {
		return "FeedBack [id=" + id + ", sysCustomer=" + sysCustomer + ", phone=" + phone + ", content=" + content
				+ ", createTime=" + createTime + ", sysUsers=" + sysUsers + ", returContent=" + returContent
				+ ", updateTime=" + updateTime + ", status=" + status + "]";
	}	
	
	
}
